filechooser: In testfilechooser, be strict about the --action option
authorFederico Mena Quintero <federico@gnome.org>
Fri, 21 Jun 2013 15:19:54 +0000 (10:19 -0500)
committerFederico Mena Quintero <federico@gnome.org>
Fri, 21 Jun 2013 15:41:39 +0000 (10:41 -0500)
It would default to GTK_FILE_CHOOSER_ACTION_OPEN if the user's specified --action could not be
parsed.  I can never remember what the right options are, so make the program bail out
if the user specifies an unrecognized option.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
tests/testfilechooser.c

index 7959411ed97b3a5f6568a2c89c083465f9ed5bc5..90cacfb868f9c53fd341c35bef68733df212d119 100644 (file)
@@ -566,6 +566,11 @@ main (int argc, char **argv)
        action = GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER;
       else if (! strcmp ("create_folder", action_arg))
        action = GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER;
+      else
+       {
+         g_print ("--action must be one of \"open\", \"save\", \"select_folder\", \"create_folder\"\n");
+         return 1;
+       }
 
       g_free (action_arg);
     }